#include "FileUtils.h"

#include <iostream>

enum EReturnCode {RC_SUCCEEDED = 0, RC_INVALID_START_DIRECTORY};

int main(int argc, char* argv[]) {
	std::ios::sync_with_stdio(false);
	std::cout << "Start working..." << std::endl;

	std::string startDirectory;
	if (argc < 2) {
		std::cout << "Enter full path to the directory you want to scan:" << std::endl;
		std::getline(std::cin, startDirectory);
	} else {
		startDirectory = argv[1];
	}
	
	if (isDirectory(startDirectory) == false) {
		std::cout << "Invalid start directory." << std::endl;
		return RC_INVALID_START_DIRECTORY;
	}

	std::string logFileName = "";
	if (argc < 3) {
		std::cout << "Enter log file name(Left empty for screen output):" << std::endl;
		std::getline(std::cin, logFileName);
	} else {
		logFileName = argv[2];
	}

	scanDirectory(startDirectory, logFileName);

	return RC_SUCCEEDED;
}